﻿using System;

namespace cSharpHomework2_2
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] arr = { 1, 5, 3, 6, 7, 2, 3, 5, 1, 1, 7, 8, 9, 4, 5, 2, 3, 4, 5 };
            int total = 0;
            for (int i = 0; i < arr.Length; i++)
            {
                for (int j = 0; j < arr.Length - i - 1; j++)
                {
                    if (arr[j] > arr[j + 1])
                    {
                        int temp = arr[j + 1];
                        arr[j + 1] = arr[j];
                        arr[j] = temp;
                    }
                }

            }
            for (int i = 0; i < arr.Length; i++)
            {
                total += arr[i];
            }
            int average = total / arr.Length;
            int Max = arr[arr.Length - 1];
            int Min = arr[0];
            Console.WriteLine("最大" + Max);
            Console.WriteLine("最小" + Min);
            Console.WriteLine("平均" + average);
            Console.WriteLine("总共" + total);



        }
    }
}
